package com.gzxw.mogublog.utils;

import java.util.Map;

public class R {

    private String  code;

    private String message;

    private Object data;

    // 返回成功
    public static R success(String message, Object data) {
        R result = new R();
        result.code = "200";
        result.message = message;
        result.data = data;
        return result;
    }

    public static R success(String message,Map<String ,Object> map) {

        R result = new R();
        result.code = "200";
        result.message = message;
        result.data = map;
        return result;

    }
    public static R success(String code, String message) {
        R result = new R();
        result.code = code;
        result.message = message;
        return result;
    }


    public static R error(String code,String message) {
        R result = new R();
        result.code = code;
        result.message = message;
        return result;
    }

    public R() {
    }

    public R(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
